<template>
  <div class="contentWeb clear">
    <div class="member_menu">
      <Companyleft active="meet"/>
    </div>
    <div class="member_right ">
      <div class="listcount">共申请过<span>{{total}}场</span>招聘会</div>
      <div class="personTengt">

        <div class="joincontent clear" v-for="(item,index) in ListList" :key="index">
          <div class="sutatusimg"
            :class="{ will: item.joinStatus*1  === 2, doing: item.joinStatus == 3, end: item.joinStatus == 4}"></div>
          <div class="joinLeft">
            <img :src="item.banner">
          </div>
          <div class="joinRight">
            <div class="titlte" @click="todetail(item)" style="overflow: hidden;
     white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 500px;">{{item.title}}</div>
            <div class="deac"><span>举办城市</span><span class="nr">{{item.city}}</span></div>
            <div class="deac"><span>详细地址</span><span class="nr">{{item.address}}</span></div>
            <div class="deac"><span>咨询电话</span><span class="nr">{{item.telno}} {{item.telno2}}</span></div>
            <div class="deac"><span>举办时间</span><span class="nr">{{item.starttime}} - {{item.endtime}}</span></div>
          </div>
          <div class="btnstu">
            <button v-if="!item.spzt" type="button" class="cancelbm doing">审核中</button>
            <button v-else-if ="item.spzt == 2" type="button" class="cancelbm pass">审核通过</button>

            <el-popover v-else-if="item.spzt == 3"
              placement="bottom"
              trigger="click"
              :content="item.reason">
              <button slot="reference" type="button" class="cancelbm fail">未通过，查看原因</button>
            </el-popover>

          </div>
        </div>
        <div style="text-align: center" v-if="total > 0">
          <el-pagination background layout="prev, pager, next"
          @current-change="getpost"
          :current-page="search.pageNum"
          :page-size="search.pageSize"
          :page-count="totalPages"></el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>
<script type="text/babel">
// @ is an alias to /src

import Companytitle from '../../components/companytitle'
import Upload from '../../components/upload'
import Companyleft from '../../components/companyleft'
import { JobFairEnterprisesByPage } from '../../assets/js/domains'

export default {
  name: 'Meet',
  components: {
    Companyleft,
    Upload,
    Companytitle
  },
  directives: {},
  data: function () {
    return {
      total: 0,
      totalPages: 0,
      form: {},
      ListList: [{
        zhiwei: '前端',
        xinzi: '5000-9000',
        diqu: '沈阳',
        jingyan: '1年',
        xueli: '本科',
        renshu: '5',
        status: '招聘中',
        time: '2020-12-12'
      }],
      search: { enterprise_uid: '', pageNum: 1, pageSize: 5 },
      uplaodstyle: {
        width: '120px',
        height: '160px'
      }
    }
  },
  created: function () {
    document.documentElement.scrollTop = document.body.scrollTop = 0
    this.search.enterprise_uid = localStorage.getItem('md_enterpriseUid')
  },
  computed: {},
  mounted: function () {
    if (this.search.enterprise_uid) {
      this.getpost()
    }
  },
  methods: {
    addform: function () {
      this.$router.push({ path: '/addJob' })
    },
    onSubmit: function () {
    },
    getpost (page) {
      const _this = this
      page && (this.search.pageNum = page)
      JobFairEnterprisesByPage(this.search).then(function (res) {
        if (res.code === 200) {
          _this.ListList = res.data.content
          _this.total = res.data.totalElements
          _this.totalPages = res.data.totalPages
        }
      })
    },
    todetail: function (row) {
      window.location.href = 'joinDetail.html?id=' + row.jfId + '&joinStatus=' + row.joinStatus
    }
  }
}
</script>
<style lang="less" scoped>
  @import "../../assets/css/member";
</style>
